<?php
require_once ('igb.php');
require_once 'dbconfig.php';
require_once ('./classes/corp/class.corp.store.php');
//IGBRequireTrust ();
?>
<html>
<head>
<title>SWAMP Corporate Store</title>
</head>
<body>
<?php
$store = new corpStore();
$store->setCredentials(DB_HOST,DB_USER,DB_PASS,DB_NAME);

//if (! IGBDetect ()) {
//	echo "This page only supports Eve In Game Browser";
//} else {
	echo "<IMG SRC=\"corplogo:1883732237\" width=32 height=32><h1>S.W.A.M.P. Corporate Store</h1><br><br>";
	
	//if (isDirector()) {
//		echo "you are a Director<br>";
//	}//end director check
	
	$items = $store->getItems();
	echo "<table border=1><tr><td><b>Item</b></td><td align=\"right\"><b>Qty On Hand</b></td><td><b>Price</b></td></tr>\n";
	foreach($items as $i){
		while (list($k,$v) = each($i)){
			switch($k){
				case "typeName";
				  $itemName = $v;
				  break;
				case "qty_onhand";
				  $qtyOH = $v;
				  break;
				case "price";
				 $price = $v;
				 break;
			}//end switch
		}
		echo "<tr><td> $itemName </td> <td> $qtyOH </td> <td> $price </td></tr>";
		
	}// end of foreach loop
	   echo "</table>" 
//}//end igb check

?>
</body>
</html>